﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Tong;
using Tong.Fy;
using System.Text.RegularExpressions;
public partial class aspnet_testPargrameDir_site_temp : System.Web.UI.Page
{

    /// <summary>
    /// 数据操作通用类 实例 TextData
    /// </summary> 
    public TongUse TextData = new TongUse();

    /// <summary>
    /// 系统安装绝对路径
    /// </summary>
    public string Abs_Path = TongUse.SysPath;
    /// <summary>
    /// 用户存放数据的临时表
    /// </summary>
    DataTable MyDt = new DataTable();
    /// <summary>
    /// 站点通用方法类
    /// </summary>
    public Tong.ThisSiteUse.SiteTong TextThisSite = new Tong.ThisSiteUse.SiteTong();

    public string str = "";
    protected void Page_Load(object sender, EventArgs e)
    {

        updtaesss();

    }


    void updtaesss()
    {
        string sql ="";
        string param = "";
        string link = "";
        if (TextData.CurrentPage == "Default.aspx")
        {
            MyDt = TextData.SqlataSet("select top 3 * from [CX_Column] where [CX_Column_LX]<>3 and [CX_Column_followid]=0  and Rtrim([CX_Column_Explair])<>'' order by [CX_Column_Sort] desc ,[CX_Column_id] desc ").Tables[0];
        }
        else
        {
            MyDt = TextData.SqlataSet("select * from [CX_Column] where [CX_Column_LX]<>3 and [CX_Column_followid]=0  and Rtrim([CX_Column_Explair])<>'' order by [CX_Column_Sort] desc ,[CX_Column_id] desc ").Tables[0];
        }
        WebSite.DataSource = MyDt;
        WebSite.DataBind();
    }

    /// <summary>
    /// 帮定二级分类
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void WebSite_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        string ColumnID = DataBinder.Eval(e.Item.DataItem, "CX_Column_id").ToString();

        DataTable NewDt = new DataTable();
        NewDt = TextData.SqlataSet("select * from [CX_Column] where [CX_Column_LX]<>3 and [CX_Column_followid]=" + ColumnID + "").Tables[0];
        Repeater MyRe = (Repeater)e.Item.FindControl("WebSite1");
        MyRe.DataSource = NewDt;
        MyRe.DataBind();

    }
    /// <summary>
    /// 帮定三级分类
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void WebSite1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        string ColumnID = DataBinder.Eval(e.Item.DataItem, "CX_Column_id").ToString();

        DataTable NewDt = new DataTable();
        NewDt = TextData.SqlataSet("select * from [CX_Column] where [CX_Column_LX]<>3 and [CX_Column_followid]=" + ColumnID + "").Tables[0];
        Repeater MyRe = (Repeater)e.Item.FindControl("WebSite2");
        MyRe.DataSource = NewDt;
        MyRe.DataBind();

    }
}
